import axios from '@/utils/request'

import config from '@/common/config'

let base = config.getMkBasePath();


/**
 * 商品团购表
 *1    默认只开放普通查询，所有查询，只要上传	 分页参数 {currentPage:当前页码从1开始,pageSize:每页记录数,total:总记录【数如果是0后台会自动计算总记录数非0不会自动计算】}，后台都会自动按分页查询 其它 api用到再打开，没用到的api请注释掉，
 *2 查询、新增、修改的参数格式  params={id:'主键ID 主键',goodsId:'商品的ID',goodsSpeciIds:'商品的规格ID集(新模式：存mall.goods_specification.id)',gbuyPrice:'团购成功的价格',goodsName:'商品名称',goodsSpeciDec:'商品规格描述',activityId:'团购活动定义编号',gbuyLeastSum:'团购需要的数量',userMinNum:'每个用户最低购买数量',userMaxNum:'每个用户最高购买数量',gbuyNum:'团购商品数量（总量）',gbuyFreezeNumber:'团购商品冻结数量',locationId:'门店ID',shopId:'商铺ID',retailPrice:'零售价（原价）',gbuyDistributionNum:'分配给团购商品数量（创建时=GBUY_NUM）',picUrl:'商品图片',adId:'广告文案',isSetDist:'是否启用分销提成',distRuleRewardId:'分销提成规则配置ID',isSetMember:'是否启用会员提成(暂时不用)',memberRuleRewardId:'会员提成规则配置ID(暂时不用)'}
 **/
 
//普通查询 条件之间and关系  
export const listGbuyActivityGoods = params => { return axios.get(`${base}/mk/join/gbuyActivityGoods/list`, { params: params }); };
export const listGbuyActivityGoodsAndGoodsNumber = params => { return axios.get(`${base}/mk/join/gbuyActivityGoods/listAndGoodsNumber`, { params: params }); };
//模糊查询商品团购表 条件之间or关系  
//export const listGbuyActivityGoodsKey = params => { return axios.get(`${base}/mk/join/gbuyActivityGoods/listKey`, { params: params }); };

//删除一条商品团购表 params={id:'主键ID 主键'}
export const delGbuyActivityGoods = params => { return axios.post(`${base}/mk/join/gbuyActivityGoods/del`,params); };

//批量删除商品团购表  params=[{id:'主键ID 主键'}]
export const batchDelGbuyActivityGoods = params => { return axios.post(`${base}/mk/join/gbuyActivityGoods/batchDel`, params); };

//修改一条商品团购表记录
export const editGbuyActivityGoods = params => { return axios.post(`${base}/mk/join/gbuyActivityGoods/edit`, params); };

//新增一条商品团购表
export const addGbuyActivityGoods = params => { return axios.post(`${base}/mk/join/gbuyActivityGoods/add`, params); };

//查询团购商品详细信息
export const selectListGBuyGoodsSKU = params => { return axios.get(`${base}/mk/join/gbuyActivity/selectListGBuyGoodsSKU`, { params: params }); };


//批量保存商品团购表  params=[{id:'主键ID 主键'}]
export const batchEditGbuyActivityGoods = params => { return axios.post(`${base}/mk/join/gbuyActivityGoods/batchEdit`, params); };
